package com.xiaoshuidi.cloud.module.system.dal.mysql.oauser;

import com.xiaoshuidi.cloud.framework.common.pojo.PageResult;
import com.xiaoshuidi.cloud.framework.mybatis.core.mapper.BaseMapperX;
import com.xiaoshuidi.cloud.framework.mybatis.core.query.QueryWrapperX;
import com.xiaoshuidi.cloud.module.system.controller.admin.oauser.vo.OaUserSearchVO;
import com.xiaoshuidi.cloud.module.system.dal.dataobject.oauser.OaUsersDO;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Mapper;

/**
	* @author dujianguang
	*/
@Mapper
public interface OaUserMapper extends BaseMapperX<OaUsersDO> {
		default PageResult<OaUsersDO> selectPage(OaUserSearchVO searchVO) {
				return selectPage(searchVO, new QueryWrapperX<OaUsersDO>()
												.or().like(StringUtils.isNotEmpty(searchVO.getIntegrated()),"username", searchVO.getIntegrated())
												.or().like(StringUtils.isNotEmpty(searchVO.getIntegrated()),"mobile", searchVO.getIntegrated())
												.eq("deleted",0)
												.orderByDesc("id"));
		}
}
